package com.mars.logger.enums;

public enum ActionType {

	LOGIN(1, "用户登录"),
	
	LOGOUT(2, "用户登出"),
	
	INSERT(3, "添加"),
	
	UPDATE(4, "修改"),
	
	DELETE(5, "删除"),
	
	SELECT(6, "查询"),
	
	BUSINESS(7, "业务操作"),
	
	UNKNOWN(8, "未知");
	
	private int index ;
	
	private String name ;

	private ActionType(int index, String name) {
		this.index = index;
		this.name = name;
	}
	
	public static String getName(int index) {
		for(ActionType actionType : ActionType.values()) {
			if(actionType.getIndex() == index) {
				return actionType.getName() ;
			}
		}
		return null ;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
}
